package cn.okcode.api.framework;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * action上下文，记录action的相关信息
 *
 * @author pyk13
 */
public class ActionContext {
    private final Callee callee;
    private final HttpServletRequest request;
    private final HttpServletResponse response;
    private Object[] parameters;
    private Object result;
    private Throwable throwable;

    public ActionContext(Callee callee, HttpServletRequest request, HttpServletResponse response) {
        this.callee = callee;
        this.request = request;
        this.response = response;
    }

    public Callee getCallee() {
        return callee;
    }

    public HttpServletRequest getRequest() {
        return request;
    }

    public HttpServletResponse getResponse() {
        return response;
    }

    public Object[] getParameters() {
        return parameters;
    }

    public void setParameters(Object[] parameters) {
        this.parameters = parameters;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public void setThrowable(Throwable throwable) {
        this.throwable = throwable;
    }
}
